home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
batchut
/
rbsetnv1.zip
/
MAKEFILE
< prev
next >
Wrap
Text File
|
1991-01-07
|
5KB
|
149 lines
###############################################################################
# makefile for SETENV, EVAL and miscellaneous related bits - Turbo C
#
# This makefile runs under NDMAKE - needs editing with Borland make
# It assumes no turboc.cfg, make.ini, makefile.mak or other accessories
# It also assumes 4DOS as the shell - the "except" command in backup uses this
# and various other pieces of syntax depend on this, but I'm sure you get
# the idea.
# R. Brittain, Jan 91
###############################################################################
.SUFFIXES : .doc .man .nro .obj .c .asm
.RESPONSE_LINK : tlink
.c.obj:
$(CC) $(FLAGS) -D${DEFINES} -c $<
# use termansi if you can display the bold/underlining etc.
# use termnull for plain ascii formatting
.nro.doc:
ro -man $< | termnull > $@
CC = tcc
LINK = c:\tc\tlink
TC = c:\tc
LIBS = $(TC)\lib
FLAGS = -f- -K -O -d -w- -I$(TC)\INCLUDE
# Optional defines:
# DEBUG for hacking - turns on miscellaneous debugging output,
# SWITCH to force subshells to use "/" instead of current switchar
# FIXARG0 used by wildargv.c to put argv[0] in unix form
# SORTARGS used by wildargv.c to sort all wildcard expansions
# UNIXCOMPAT sets environment variable tag to $ instead of %
# and also disables upper-casing of environment variables (variables
# entered as typed on the command line)
DEFINES= FIXARG0;SORTARGS
# Directories used by installation
BINDIR = C:\BIN
MANDIR = C:\MAN\MAN1
#######################################################################
# Compilation
#######################################################################
JUNK = *.obj *.bak *.i *.map junk*.*
OBJCOMM = wildargv.obj comsub.obj envfuncs.obj popen.obj getswitc.obj dup.obj
OBJSETENV = setenv.obj ${OBJCOMM}
OBJEVAL = eval.obj ${OBJCOMM}
usual: setenv.exe eval.exe
examples : incr.com uprompt.com \
inspath.com delpath.com addpath.com chgpath.com
all : usual examples
setenv.exe : $(OBJSETENV)
$(LINK) $(LIBS)\c0s $(OBJSETENV),setenv,,$(LIBS)\cs
eval.exe : $(OBJEVAL)
$(LINK) $(LIBS)\c0s $(OBJEVAL),eval,,$(LIBS)\cs
eval.obj setenv.obj : comsub.h
#######################################################################
# Miscellaneous other utilities that use these routines
# Included more as examples than really useful items
#######################################################################
uprompt.com : uprompt.c envfuncs.c
$(CC) -mt $(FLAGS) -D$(DEFINES) -ouprompt uprompt.c
exe2bin uprompt uprompt.com
del uprompt.exe
incr.com : incr.c envfuncs.c
$(CC) -mt $(FLAGS) -D$(DEFINES) -oincr incr.c
exe2bin incr incr.com
del incr.exe
addpath.com : addpath.c envfuncs.c
$(CC) -mt $(FLAGS) -D$(DEFINES) -oaddpath addpath.c
exe2bin addpath addpath.com
del addpath.exe
delpath.com : delpath.c envfuncs.c
$(CC) -mt $(FLAGS) -D$(DEFINES) -odelpath delpath.c
exe2bin delpath delpath.com
del delpath.exe
chgpath.com : chgpath.c envfuncs.c
$(CC) -mt $(FLAGS) -D$(DEFINES) -ochgpath chgpath.c
exe2bin chgpath chgpath.com
del chgpath.exe
inspath.com : inspath.c envfuncs.c
$(CC) -mt $(FLAGS) -D$(DEFINES) -oinspath inspath.c
exe2bin inspath inspath.com
del inspath.exe
#######################################################################
# Maintenance
#######################################################################
backup :
except ($(JUNK) mk0*.bat *.zoo *.zip) zoo aunP setenv *
distrib:
# zoo aunPP dist/setenv *.c *.h *.exe *.com *.doc *.nro makefile readme \
# tcconfig.tc eval.prj setenv.prj
pkzip -a dist/rbsetnv1 *.c *.h *.exe *.com *.doc *.nro \
makefile readme tcconfig.tc eval.prj setenv.prj
wrap : backup clobber
except (*.zip *.zoo makefile) del -y *.*
unwrap :
zoo x// setenv
clean :
del $(JUNK)
clobber : clean
-del setenv.exe eval.exe incr.com uprompt.com \
addpath.com inspath.com chgpath.com delpath.com
#######################################################################
# Installation
#######################################################################
install : $(BINDIR)\setenv.exe $(BINDIR)\eval.exe \
$(MANDIR)\setenv.doc $(MANDIR)\eval.doc
$(MANDIR)\setenv.doc : setenv.doc
copy setenv.doc $(MANDIR)
$(MANDIR)\eval.doc : eval.doc
copy eval.doc $(MANDIR)
$(BINDIR)\setenv.exe : setenv.exe
copy setenv.exe $(BINDIR)
$(BINDIR)\eval.exe : eval.exe
copy eval.exe $(BINDIR)